package dy.com.part1.chapter1;


import java.util.concurrent.TimeUnit;

public class TryConcurrency {
    public static void browseNews() {
        for(;;){
            System.out.println("good news");
            sleep(1);
        }
    }

    public static void enjoyMusic() {
        for(;;){
            System.out.println("good music");
            sleep(1);
        }
    }
    public static void sleep(int seconds)  {
        try{
            TimeUnit.SECONDS.sleep(seconds);
        }
        catch (InterruptedException e){
            e.printStackTrace();
        }

    }
}
